/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.menosehmais.business;

import br.com.caelum.vraptor.ioc.Component;
import br.com.menosehmais.framework.business.CrudBusinessObject;
import br.com.menosehmais.model.ContaDO;
import br.com.menosehmais.model.PortletDO;
import br.com.menosehmais.model.RejectedDO;
import br.com.menosehmais.persistence.RejectedDAO;

/**
 *
 * @author Junior JAFJ
 */
@Component
public class RejectedBO extends CrudBusinessObject<RejectedDO, RejectedDAO>{

    public RejectedBO(RejectedDAO dao) {
        super(dao);
    }

    public RejectedDO getObjectRejected(PortletDO portletDO, ContaDO contaDO) {
        RejectedDO rejectedDO = new RejectedDO();
        rejectedDO.setReferenceId(portletDO.getId());
        rejectedDO.setAccount(null);    //TODO REFATOR APOS IMPLEMENTAR O LOGIN

        try {
            rejectedDO = dao.selectUsingFilter(rejectedDO).get(0);
        } catch (Exception e) {
            // TO-DO...
        }
        return rejectedDO;
    }
}
